<!DOCTYPE HTML>
<html class="center-html" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>个人中心</title>
    <link rel="stylesheet" type="text/css" href="css/aui.css" />
		<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>
<body class="center-body">
    <div class="site-name">
      <p>北京114预约挂号平台</p>
    </div>

    <div class="center-header">
      <div class="center-account">
          <div class="center-name" id="aaa">
          </div>
        <div class="center-name">
            <span id="bq">未登陆</span>
        </div>
        <div class="center-status" id="stas">
          <!--<p id="sta" >-->
              <!--<img src="images/safe.png" alt="">-->
              <!--<span id="authentication">未认证</span>-->
          <!--</p>-->
          <!--<i class="aui-iconfont aui-icon-right"></i>-->
        </div>
      </div>
    </div>

    <div class="center-nav">
      <a class="center-item" href="user.html">
        <img src="/images/user.png" alt="">
        <span>就诊人</span>
      </a>
      <a class="center-item" href="orders.html">
        <img src="/images/order.png" alt="">
        <span>挂号订单</span>
      </a>
    </div>

    <div class="center-list">
      <a class="center-sub" href="phone.html">
        <div class="center-icon">
          <img src="/images/phone.png" alt="" class="icon-phone">
        </div>
        <div class="center-title">
          <p>修改登录手机号</p>
          <span></span>
        </div>
        <i class="aui-iconfont aui-icon-right"></i>
      </a>

      <a class="center-sub" href="weixin.html">
        <div class="center-icon">
          <img src="/images/weixin.png" alt="" class="icon-weixin">
        </div>
        <div class="center-title">
          <p>绑定微信</p>
          <span>未绑定</span>
        </div>
        <i class="aui-iconfont aui-icon-right"></i>
      </a>

      <a class="center-sub" href="more.html">
        <div class="center-icon">
          <img src="/images/more.png" alt="" class="icon-more">
        </div>
        <div class="center-title">
          <p>更多</p>
          <span></span>
        </div>
        <i class="aui-iconfont aui-icon-right"></i>
      </a>
    </div>

    <div class="center-exit">
      <a id="login" href="login.html">登录</a>
    </div>
    <div class="center-subb">
        <img src="/images/index.png" id="index" width="50px" height="50px">
    </div>
</body>
<script src="js/jquery.min.js"></script>
<!--<script src="js/jquery-1.8.3.min.js"></script>-->
<script src="js/url.js"></script>
<script type="text/javascript">

    /**
     * 跳转到首页
     */
    $("#index").click(function(){
        window.location.replace("index.html");
    });


    aa();
    //显示手机号
    function aa(){
        $.ajax({
            url: getUrl() + "wechat114/platform/acquisitionSession",
            success: function (data) {
                var str = "";
              var platformPhone =data.toString()
                    if (platformPhone== 'null' ) {
                       $("#login").html("登录");
                    } else {
                        $("#login").html("退出登录")
                        document.getElementById("bq").innerText = data.toString();
                        // var platformName = decodeURI(location.href.split("=")[1]);
                        // // if (platformName != 'undefined'||platformName != 'null') {
                        // //     str += " <span id=\"pname\">" + platformName + "</span>"
                        // //     $("#aaa").html(str)
                        // //     $("#authentication").html("以认证")
                        // // }
                    }
                }
        })
    }
    //实名认证状态
    f();
function f() {
    $.ajax({
        url: getUrl() + "wechat114/platform/state",
        success: function (data) {
        var str="";
            var strs="";
            if (data.code=='-1') {
                str+=" <p id=\"sta\" >\n" +
                    "              <img src=\"images/safe.png\" alt=\"\">\n" +
                    "              <span id=\"authentication\">未认证</span>\n" +
                    "          </p>\n" +
                    "          <i class=\"aui-iconfont aui-icon-right\"></i>";
            }else if (data.code=='0'){
                str+=" <p id=\"sta\" >\n" +
                    "              <img src=\"images/safe.png\" alt=\"\">\n" +
                    "              <span id=\"as\">已认证</span>\n" +
                    "          </p>\n" +
                    "          <i class=\"aui-iconfont aui-icon-right\"></i>";
                strs += " <span id=\"pname\">" +data.data.platformName + "</span>";
                $("#aaa").html(strs)

            }
            $("#stas").html(str);
            //点击显示实名认证信息
            $("#as").click(function() {
                alert("姓名："+data.data.platformName+"\n"+"居民身份证："+data.data.platformIdnumber)
            })
            /**
             * 跳转到实名认证页面
             */
            $("#authentication").click(function(){
                window.location.replace(getUrl() +"authenticationadd.html");
            });
        }
    })
}

</script>
</html>
